<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>do_while乘法表</title>
    <style>
        html{
            font-family: monospace;
        }
    </style>
    <script>
        document.write("格式一：");
        document.write("<br><br>");
        var i=1;
        do{
            var j=1;
            do{
                document.write(i+"*"+j+"="+i*j+(i*j<10?"&nbsp;&nbsp;":"&nbsp;"));
                j++;

            }
            while(j<=i)
            document.write("<br>");
            i++;

        }
        while(i<=9)
        document.write("<br>");
        document.write("格式二：");
        document.write("<br><br>");
        var i=9;
        do{
            var j=1;
            do{
                document.write(i+"*"+j+"="+i*j+(i*j<10?"&nbsp;&nbsp;":"&nbsp;")); 
                j++;
            }
            while(j<=i)
            document.write("<br>");
            i--;

        }
        while(i>=1)

        document.write("<br>");
        document.write("格式三：");
        document.write("<br><br>");
        var i=1;
        do{
            if(i!=9){
            var j=1;
            do{
                document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                j++;
            }
            while(j<=9-i)
            }
            var k=1;
            do{
                document.write(i+"*"+k+"="+i*k+(i*k<10?"&nbsp;&nbsp;":"&nbsp;"));
                k++;
            }
            while(k<=i)
            document.write("<br>")
            i++;
        }
        while(i<=9)

        document.write("<br>");
        document.write("格式四：");
        document.write("<br><br>");

        var i=9;
        do{
            if(i!=9){
                var j=1;
                do{
                    document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                    j++;
                }
                while(j<=9-i)
            }
            var k=i;
            do{
                document.write(i+"*"+k+"="+i*k+(i*k<10?"&nbsp;&nbsp;":"&nbsp;"));
                k--;
            }
            while(k>=1)
            document.write("<br>");
            i--;

        }
        while(i>=1)


    </script>
</head>
<body>
    
</body>
</html>